<?php
/**
 * Author: Administrator
 * Date: 2022/8/3 1:38
 */

namespace DesignPatterns\Behavioral\Specification;


abstract class AbstractSpecification implements SpecificationInterface
{

    abstract public function isSatisfiedBy(Item $item);

    public function both(SpecificationInterface $s)
    {
        return new Both($this, $s);
    }

    public function either(SpecificationInterface $s)
    {
        return new Either($this, $s);
    }

    public function not()
    {
        return new Not($this);
    }
}